Repository navigation
Preserve pathname bytes in refcount unlink - #664
Merged
Merged
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refcount
unlinkcan delete another file when a pathname contains non-UTF-8 bytes. Lossy text conversion can turn a missing byte-named target into the name of an existing file containing the UTF-8 replacement character.rules/unistd/tgt_refcount.rsnow passes the pathname through the existingwith_c_bytesview directly to nix. This preserves the bytes up to the first NUL without changing the shared text-conversion helper. The success return and error-to-errno mapping stay unchanged, and the generated code remains safe Rust.tests/unit/unlink_bytes.ccreates a replacement-character sibling, attempts to unlink a distinct missing non-UTF-8 pathname, and checks the failure result, errno, and sibling survival. Expected refcount output is also regenerated for the affected existing unlink consumers.Testing
Scoped lit tests for unlink and its affected generated-code consumers report 11 passed, 0 failed, and 0 skipped, exercising native C and both Rust models.
This change is limited to refcount
unlink; other pathname rules are unchanged. macOS validation is left to target CI.Case and evidence
Made by Perfloop.